package com.glsc.ngateway.common.api.platform.dto.gitee;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.glsc.ngateway.common.api.platform.dto.gitee.issueBase.IssueStateDto;
import com.glsc.ngateway.common.api.platform.dto.gitee.issueBase.IssueTypeDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import javax.persistence.MappedSuperclass;
import java.io.Serializable;
import java.util.List;

/**
 * @author zhengyr
 * @date 2024/1/23-10:53
 */
@Data
@SuperBuilder
@AllArgsConstructor
@NoArgsConstructor
@JsonInclude(JsonInclude.Include.ALWAYS)
@MappedSuperclass
public class IssueBaseDto implements Serializable {
    @ApiModelProperty(value = "id")
    private Integer id;

    @ApiModelProperty(value = "root_id")
    private Integer root_id;

    @ApiModelProperty(value = "父任务id")
    private Integer parent_id;

    @ApiModelProperty(value = "仓库id")
    private Integer project_id;

    @ApiModelProperty(value = "项目id")
    private Integer program_id;

    @ApiModelProperty(value = "任务状态item")
    private IssueStateDto issue_state;

    @ApiModelProperty(value = "任务类型item")
    private IssueTypeDto issue_type;

    @ApiModelProperty(value = "任务标识码")
    private String ident;

    @ApiModelProperty(value = "任务标题")
    private String title;

    @ApiModelProperty(value = "任务状态id 字典:gitee_issue_state 待办的、测试中、已结束等")
    private String issue_state_id;

    @ApiModelProperty(value = "任务状态,开启：open 关闭：closed 拒绝：rejected 进行中: progressing")
    private String state;

    @ApiModelProperty(value = "优先级code")
    private Integer priority;
    @ApiModelProperty(value = "优先级中文含义")
    private String priority_human;

    @ApiModelProperty(value = "协作者列表 多个")
    private List<GiteeMemberDto> collaborators;

    @ApiModelProperty(value = "负责人明细")
    private GiteeMemberDto assignee;
    @ApiModelProperty(value = "创建人明细")
    private GiteeMemberDto author;
    @ApiModelProperty(value = "计划开始时间")
    //    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
//    @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXX")
//    @JsonSerialize(using = LocalDateTimeSerializer.class)
//    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    private String plan_started_at;

    @ApiModelProperty(value = "计划截止时间")
    private String deadline;

    @ApiModelProperty(value = "实际开始时间")
    private String started_at;

    @ApiModelProperty(value = "任务完成时间")
    private String finished_at;

    @ApiModelProperty(value = "创建时间")
    private String created_at;

    @ApiModelProperty(value = "更新时间")
    private String updated_at;

    @ApiModelProperty(value = "逾期天数")
    private Long overDays;

}
